﻿// MT450




using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category4
{
  public class MT450 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagDefinition U0002;
    private static SwiftTagSubItemDefinition U0003;
    private static SwiftTagDefinition U0004;
    private static SwiftTagSequenceDefinition U0005;
    private static SwiftTagDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagSubItemDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagChoiceDefinition U0015;
    private static SwiftTagDefinition U0016;
    private static SwiftTagSubItemDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagDefinition U0019;
    private static SwiftTagSubItemDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;
    private static SwiftTagDefinition U001C;
    private static SwiftTagSubItemDefinition U001D;
    private static SwiftTagSubItemDefinition U001E;

    [Description("Account Identification")]
    public Tag25 AccountIdentification_25
    {
      get
      {
        return new Tag25((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U0002);
      }
    }

    [Description("Account Identification")]
    public Tag25 Tag25_AccountIdentification
    {
      get
      {
        return this.AccountIdentification_25;
      }
    }

    [Description("SenderTo Receiver Information")]
    public Tag72 SenderToReceiverInformation_72
    {
      get
      {
        return new Tag72((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U0004);
      }
    }

    [Description("SenderTo Receiver Information")]
    public Tag72 Tag72_SenderToReceiverInformation
    {
      get
      {
        return this.SenderToReceiverInformation_72;
      }
    }

    [Description("Transaction Reference Number")]
    public MT450.SequenceClass[] Sequence
    {
      get
      {
        int index = -1;
        List<MT450.SequenceClass> list = new List<MT450.SequenceClass>();
        int count;
        do
        {
          ++index;
          MT450.SequenceClass sequenceClass = new MT450.SequenceClass((SwiftElement) this, index, false);
          count = this.ListTags((SwiftElement) sequenceClass).Count;
          if (count > 0)
            list.Add(sequenceClass);
        }
        while (count > 0);
        return list.ToArray();
      }
    }

    public MT450()
      : base(true)
    {
    }

    public MT450(SwiftMessage message)
      : base(message)
    {
    }

    public MT450.SequenceClass AddSequence()
    {
      return new MT450.SequenceClass((SwiftElement) this, this.Sequence.Length, true);
    }

    public void RemoveSequence(MT450.SequenceClass sequence)
    {
      foreach (SwiftTag tag in this.ListTags((SwiftElement) sequence))
        this.RemoveTag(tag);
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT450.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT450.MessageDefinition = new SwiftMessageDefinition("MT450", "Cash Letter Credit Advice");
      MT450.U0002 = new SwiftTagDefinition("AccountIdentification_25", "Account Identification");
      MT450.U0002.TagName = ":25:";
      MT450.U0002.Mandatory = false;
      MT450.U0003 = new SwiftTagSubItemDefinition("AccountIdentification", "Account Identification");
      MT450.U0002.Elements.Add((SwiftDefinitionElement) MT450.U0003);
      MT450.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT450.U0002);
      MT450.U0004 = new SwiftTagDefinition("SenderToReceiverInformation_72", "SenderTo Receiver Information");
      MT450.U0004.TagName = ":72:";
      MT450.U0004.Mandatory = false;
      MT450.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT450.U0004);
      MT450.U0005 = new SwiftTagSequenceDefinition("Sequence", "Transaction Reference Number");
      MT450.U0005.Multiple = true;
      MT450.U0006 = new SwiftTagDefinition("TransactionReferenceNumber_20", "Transaction Reference Number");
      MT450.U0006.TagName = ":20:";
      MT450.U0007 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT450.U0006.Elements.Add((SwiftDefinitionElement) MT450.U0007);
      MT450.U0005.Elements.Add((SwiftDefinitionElement) MT450.U0006);
      MT450.U0008 = new SwiftTagDefinition("RelatedReference_21", "Related Reference");
      MT450.U0008.TagName = ":21:";
      MT450.U000E = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT450.U0008.Elements.Add((SwiftDefinitionElement) MT450.U000E);
      MT450.U0005.Elements.Add((SwiftDefinitionElement) MT450.U0008);
      MT450.U000F = new SwiftTagDefinition("DateOfCashLetter_30", "Date Of Cash Letter");
      MT450.U000F.TagName = ":30:";
      MT450.U0010 = new SwiftTagSubItemDefinition("Date", "Date");
      MT450.U000F.Elements.Add((SwiftDefinitionElement) MT450.U0010);
      MT450.U0005.Elements.Add((SwiftDefinitionElement) MT450.U000F);
      MT450.U0011 = new SwiftTagDefinition("ValueDateCurrencyCodeAmount_32A", "Value Date Currency Code Amount");
      MT450.U0011.TagName = ":32A:";
      MT450.U0012 = new SwiftTagSubItemDefinition("Date", "Date");
      MT450.U0011.Elements.Add((SwiftDefinitionElement) MT450.U0012);
      MT450.U0013 = new SwiftTagSubItemDefinition("Currency", "Currency");
      MT450.U0011.Elements.Add((SwiftDefinitionElement) MT450.U0013);
      MT450.U0014 = new SwiftTagSubItemDefinition("Amount", "Amount");
      MT450.U0011.Elements.Add((SwiftDefinitionElement) MT450.U0014);
      MT450.U0005.Elements.Add((SwiftDefinitionElement) MT450.U0011);
      MT450.U0015 = new SwiftTagChoiceDefinition("Choice", "");
      MT450.U0015.Mandatory = false;
      MT450.U0015.Multiple = true;
      MT450.U0016 = new SwiftTagDefinition("SenderOfCashLetter_52A", "Sender Of Cash Letter");
      MT450.U0016.TagName = ":52A:";
      MT450.U0017 = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT450.U0017.Mandatory = false;
      MT450.U0016.Elements.Add((SwiftDefinitionElement) MT450.U0017);
      MT450.U0018 = new SwiftTagSubItemDefinition("BankIdentifierCode", "Bank Identifier Code");
      MT450.U0016.Elements.Add((SwiftDefinitionElement) MT450.U0018);
      MT450.U0015.Elements.Add((SwiftDefinitionElement) MT450.U0016);
      MT450.U0019 = new SwiftTagDefinition("SenderOfCashLetter_52B", "Sender Of Cash Letter");
      MT450.U0019.TagName = ":52B:";
      MT450.U001A = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT450.U001A.Mandatory = false;
      MT450.U0019.Elements.Add((SwiftDefinitionElement) MT450.U001A);
      MT450.U001B = new SwiftTagSubItemDefinition("Location", "Location");
      MT450.U001B.Mandatory = false;
      MT450.U0019.Elements.Add((SwiftDefinitionElement) MT450.U001B);
      MT450.U0015.Elements.Add((SwiftDefinitionElement) MT450.U0019);
      MT450.U001C = new SwiftTagDefinition("SenderOfCashLetter_52D", "Sender Of Cash Letter");
      MT450.U001C.TagName = ":52D:";
      MT450.U001D = new SwiftTagSubItemDefinition("PartyIdentifier", "Party Identifier");
      MT450.U001D.Mandatory = false;
      MT450.U001C.Elements.Add((SwiftDefinitionElement) MT450.U001D);
      MT450.U001E = new SwiftTagSubItemDefinition("NameAndAddress", "Name And Address");
      MT450.U001C.Elements.Add((SwiftDefinitionElement) MT450.U001E);
      MT450.U0015.Elements.Add((SwiftDefinitionElement) MT450.U001C);
      MT450.U0005.Elements.Add((SwiftDefinitionElement) MT450.U0015);
      MT450.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT450.U0005);
    }

    public class SequenceClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT450.U0005;
        }
      }

      [Description("Transaction Reference Number")]
      public Tag20 TransactionReferenceNumber_20
      {
        get
        {
          return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U0006);
        }
      }

      [Description("Transaction Reference Number")]
      public Tag20 Tag20_TransactionReferenceNumber
      {
        get
        {
          return this.TransactionReferenceNumber_20;
        }
      }

      [Description("Related Reference")]
      public Tag21 RelatedReference_21
      {
        get
        {
          return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U0008);
        }
      }

      [Description("Related Reference")]
      public Tag21 Tag21_RelatedReference
      {
        get
        {
          return this.RelatedReference_21;
        }
      }

      [Description("Date Of Cash Letter")]
      public Tag30 DateOfCashLetter_30
      {
        get
        {
          return new Tag30((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U000F);
        }
      }

      [Description("Date Of Cash Letter")]
      public Tag30 Tag30_DateOfCashLetter
      {
        get
        {
          return this.DateOfCashLetter_30;
        }
      }

      [Description("Value Date Currency Code Amount")]
      public Tag32A ValueDateCurrencyCodeAmount_32A
      {
        get
        {
          return new Tag32A((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U0011);
        }
      }

      [Description("Value Date Currency Code Amount")]
      public Tag32A Tag32A_ValueDateCurrencyCodeAmount
      {
        get
        {
          return this.ValueDateCurrencyCodeAmount_32A;
        }
      }

      [Description("Sender Of Cash Letter")]
      public Tag52A SenderOfCashLetter_52A
      {
        get
        {
          return new Tag52A((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U0016);
        }
      }

      [Description("Sender Of Cash Letter")]
      public Tag52A Tag52A_SenderOfCashLetter
      {
        get
        {
          return this.SenderOfCashLetter_52A;
        }
      }

      [Description("Sender Of Cash Letter")]
      public Tag52B SenderOfCashLetter_52B
      {
        get
        {
          return new Tag52B((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U0019);
        }
      }

      [Description("Sender Of Cash Letter")]
      public Tag52B Tag52B_SenderOfCashLetter
      {
        get
        {
          return this.SenderOfCashLetter_52B;
        }
      }

      [Description("Sender Of Cash Letter")]
      public Tag52D SenderOfCashLetter_52D
      {
        get
        {
          return new Tag52D((SwiftElement) this, 0, (SwiftDefinitionElement) MT450.U001C);
        }
      }

      [Description("Sender Of Cash Letter")]
      public Tag52D Tag52D_SenderOfCashLetter
      {
        get
        {
          return this.SenderOfCashLetter_52D;
        }
      }

      internal SequenceClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }
    }
  }
}
